﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>下拉框演示...</title>
    <script src="/Style/JS/Aries.Loader.js"></script>
</head>
<body>
    <div id="context" style="margin-left: 20px; margin-top: 20px;">
        <h3>单项</h3>
        <label>ConfigKey：</label><input type="text" configkey="性别" name="gender" />
        <label>ObjName：</label><input type="text" objname="C_PB_Province" />
        <hr />
        <h3>属性配置</h3>
        <label>defaultvalue=1：（默认值..）</label><input type="text" configkey="性别" name="gender" defaultvalue="1" /><br />
        <label>onlytext=true：（值也显示文本..）</label><input type="text" objname="C_PB_Province" onlytext="true" name="onlytext" onchange="singleSelect" /><br />
        <label>defaultitem=false：（不显示请选择..）</label><input type="text" objname="C_PB_Province" defaultitem="false" name="abc" onchange="singleSelect" /><br />
        <label>multiple=true：（多选..............）</label><input type="text" objname="C_PB_Province" multiple="true" onchange="singleSelect" /><br />
        <label>onchange=onchange：（事件...........）</label><input type="text" objname="C_PB_Province" onchange="singleSelect" />
        <hr />
        <h3>单选级联</h3>
        <label>省份：</label><input type="text" name="prov" objname="C_PB_Province2" />
        <label>城市：</label><input type="text" name="city" objname="C_PB_City2" parent="C_PB_Province2" />
        <label>区域：</label><input type="text" name="dist" objname="C_PB_District2" parent="C_PB_City2" />
        <hr />
        <h3>多选级联</h3>
        <label>省份(onchage)：</label><input type="text" objname="C_PB_Province3" multiple="true" onchange="multipleSelect" />
        <label>城市：</label><input type="text" objname="C_PB_City3" parent="C_PB_Province3" multiple="true" />
        <label>区域：</label><input type="text" objname="C_PB_District3" parent="C_PB_City3" multiple="true" />
        <hr />
        <label>省份(同一个配置，不引发级联)：</label><input type="text" objname="C_PB_Province3" multiple="true" cascade="false" onchange="multipleSelect" />
        <hr />
        <h3>树型下拉</h3>
        <label>省份（自动选择子级：cascadeCheck=true)：</label><input type="text" objname="C_PB_ProvinceCity" tree="true" multiple="true" cascadecheck="true" width="200" onchange="multipleSelect" /><br />
        <label>省份（子父各自选：cascadeCheck=false)：</label><input type="text" objname="C_PB_ProvinceCity" tree="true" multiple="true" cascadecheck="false" width="200" onchange="multipleSelect" /><br />
        <label>省份（只能选择子节点：onlyleafcheck=true)：</label><input type="text" objname="C_PB_ProvinceCity" tree="true" multiple="true" cascadecheck="false" width="200" onlyleafcheck="true" onchange="multipleSelect" /><br />

        <label>省份（单选)：</label><input type="text" objname="C_PB_ProvinceCity" tree="true" cascadecheck="false" width="200" onchange="singleSelect" />

        <hr />
        <input type="button" onclick="$('#context').toView()" value="ToView" />
    </div>
</body>
</html>
<script type="text/javascript">
    function singleSelect(record) {

        if (record.value) {
            AR.Utility.Window.showMsg([record.value, record.text].join(','));
        }
        // else { alert("1");}
    }

    function multipleSelect(record, checked) {
        if (record.value) {
            AR.Utility.Window.showMsg(record.text + "[" + record.value + "]" + " - check[" + checked + "] -- " + record.texts + "[" + record.values + "]");
        }

    }
    AR.Combobox.onAfterExecute = function (type) {
        if (type == "configkey") {
            AR.Combobox.setValues({ gender: 0 });
        }
        else {
            AR.Combobox.setValues({ onlytext: "河东区" });
            AR.Combobox.setValues({ prov: "200000000", city: "200100000" });
        }
    }


</script>
